﻿using DBAccessLibrary;
using DBAccessLibrary.Model;

namespace QueryResource.TextFormat
{

    /// <summary>
    /// 条件判断 is NULL 格式刷 
    /// </summary>
    internal class IsNullFormat : ITextFormat
    {

        #region ITextFormat 成员

        public string TextFormat(string text)
        {
            if (SysCache.DBConnection!=null && SysCache.DBConnection.ConnectType == DBType.Oracle)
            {
                return text.Replace("<>''", "IS NOT NULL")
                    .Replace("<> ''", "IS NOT NULL")
                    .Replace("=''", "IS NULL")
                    .Replace("= ''", "IS NULL");
            }
            return text;
        }

        #endregion
    }
}
